package com.sea.physical.service.impl;


import com.alibaba.fastjson.JSON;
import com.sea.physical.entity.CreatePlan;
import com.sea.physical.entity.Unusual;
import com.sea.physical.mapper.UnusualMapper;

import com.sea.physical.service.CreatePlanService;
import com.sea.physical.service.UnusualService;
import com.sea.supply.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class UnusualServiceImpl implements UnusualService {

    @Autowired
    private UnusualMapper unusualMapper;
    @Autowired
    private CreatePlanService createPlanService;
    @Autowired
    private SupplierService supplierService;

    @Override
    public List<Unusual> findByCnd(Unusual unusual) {
        return unusualMapper.findByCnd(unusual);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int save(Unusual unusual) {

        return unusualMapper.insert(unusual);
    }

    @Override
    public int delete(Integer id) {
        return unusualMapper.delete(id);
    }

    @Override
    public Unusual findById(Integer id) {
        return unusualMapper.findById(id);
    }

    @Override
    public int usave(Unusual unusual) {
        return unusualMapper.update(unusual);
    }
}
